home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / AppsToGo / DTS.Draw / DTS.Draw.make < prev    next >
Encoding:
Text File  |  1994-09-22  |  10.6 KB  |  274 lines  |  [TEXT/MPS ]

  1. #------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Sample Application
  6. #
  7. #    Program:    DTS.Draw
  8. #    File:        DTS.Draw.make    -    Make Source
  9. #
  10. #    Copyright © 1988-1994 Apple Computer, Inc.
  11. #    All rights reserved.
  12. #
  13. #------------------------------------------------------------------------------
  14.  
  15. #    The are three possible ways of making DTS.Draw with this makefile
  16. #        1) 68K only
  17. #        2) PowerPC only
  18. #        3) "Fat" - both 68K and PowerPC
  19. #    You can control which gets build using the dependency line for "AppName"
  20. #    The default is to build the fat version.  See instructions below.
  21. AppName            =    'DTS.Draw'
  22. Signature        =    'DTSD'
  23.  
  24. DTS.Lib.folder    =    "::DTS.Lib:"
  25. DTS.Lib.hdrs    =    "::DTS.Lib:DTS.Lib.headers:"
  26. projsrc            =    :
  27. obj                =     :OBJECT:
  28. objppc            =     :OBJECTPPC:
  29.  
  30. #------------------------------------------------------------------------------
  31. # Options for our compilers:
  32. #    -sym on: tells the compilers and linker to emit symbol information for
  33. #        a source level debugger, such as SADE.
  34. #    -i {DTS.Lib.hdrs}: means to look for any #include files in the specified
  35. #        directory, as well as the normal set.
  36. #    -r: tells the C compiler to require function prototypes.
  37. #    -mbg off: tells the compilers to not emit low-level debugger names. This
  38. #        saves on file space, but you may wish to remove this option if you
  39. #        need to debug with something like Macsbug.
  40. #    -rd: for Rez means to suppress warnings for redeclared types (we redeclare
  41. #        'RECT' because it’s not included in MPW 3.0).
  42. #    -append: means to add the resources to the target file, rather than
  43. #        deleting all the ones that are there first.
  44. #    -d Signature...: is a way of passing our application's signature to Rez.
  45. #        With this mechanism, we can define our signature here, and export
  46. #        it to Rez, so that we don't have to declare it there, too.
  47. #    -sn STDCLIB=Main: puts all the routines that would normally go into the
  48. #        STDCLIB segment into the Main segment. This is done so that when we
  49. #        call upon any low-level utilities, we don't potentially move memory
  50. #        by loading in a segment.
  51. #------------------------------------------------------------------------------
  52.  
  53. #    SymOptions and OptOptions are mutually exclusive.  Enable as appropriate
  54. SymOptions        =    -sym on                # turn this on to debug with SADE/R2Db
  55. COptOptions        =    #-opt on
  56. PPCCOptOptions    =    #-opt speed
  57.  
  58. # CIncludesFolder needs to be set to your Universal Interfaces folder
  59. CIncludesFolder    =    -i "{PPCCIncludes}"
  60. IncludesFolders    =    -i {DTS.Lib.hdrs}
  61. COptions        =    {IncludesFolders} {CIncludesFolder} {SymOptions} {COptOptions} -r -mbg on
  62. PPCCOptions        =    {IncludesFolders} {SymOptions} {PPCCOptOptions} -w conformance -appleext on
  63. RezOptions        =    {IncludesFolders} -rd -append -d Signature="{Signature}" -d AppName='"DTS.Draw"'
  64. LinkOptions        =    {SymOptions} {SegmentMappings} -msg nodup
  65. LinkOptionsPPC    =    {SymOptions} -main main
  66. MakeSymOptions    =    -i {DTS.Lib.folder} -r
  67. #    The -w options for MakePef makes those libraries "weak" imports, meaning
  68. #        they can be absent at runtime.  The app must check before calling them.
  69. MakePefOptions    =        -l QuickTimeLib.xcoff=QuickTimeLib~ ∂
  70.                         -w QuickTimeLib:AddMovieResource ∂
  71.                         -w QuickTimeLib:ClearMovieChanged ∂
  72.                         -w QuickTimeLib:CloseMovieFile ∂
  73.                         -w QuickTimeLib:CreateMovieFile ∂
  74.                         -w QuickTimeLib:DisposeMovie ∂
  75.                         -w QuickTimeLib:EnterMovies ∂
  76.                         -w QuickTimeLib:GetMoviesError ∂
  77.                         -w QuickTimeLib:NewMovie ∂
  78.                         -w QuickTimeLib:NewMovieFromFile ∂
  79.                         -w QuickTimeLib:OpenMovieFile ∂
  80.                         -w QuickTimeLib:StandardGetFilePreview ∂
  81.                         -w QuickTimeLib:UpdateMovieResource ∂
  82. #                        -l DragLib.xcoff=DragLib~     ... starting with ETO #15, use the line below ∂
  83.                         -l DragLib=DragLib~ ∂
  84.                         -w DragLib:AddDragItemFlavor ∂
  85.                         -w DragLib:CountDragItems ∂
  86.                         -w DragLib:DisposeDrag ∂
  87.                         -w DragLib:GetDragAttributes ∂
  88.                         -w DragLib:GetDragItemReferenceNumber ∂
  89.                         -w DragLib:GetDragModifiers ∂
  90.                         -w DragLib:GetDragMouse ∂
  91.                         -w DragLib:GetDragOrigin ∂
  92.                         -w DragLib:GetDropLocation ∂
  93.                         -w DragLib:GetFlavorData ∂
  94.                         -w DragLib:GetFlavorDataSize ∂
  95.                         -w DragLib:GetFlavorFlags ∂
  96.                         -w DragLib:HideDragHilite ∂
  97.                         -w DragLib:InstallReceiveHandler ∂
  98.                         -w DragLib:InstallTrackingHandler ∂
  99.                         -w DragLib:NewDrag ∂
  100.                         -w DragLib:RemoveReceiveHandler ∂
  101.                         -w DragLib:RemoveTrackingHandler ∂
  102.                         -w DragLib:ShowDragHilite ∂
  103.                         -w DragLib:SetDragItemBounds ∂
  104.                         -w DragLib:TrackDrag ∂
  105.                         -l InterfaceLib.xcoff=InterfaceLib
  106. SegmentMappings    =    -sn INTENV=Main ∂
  107.                     -sn PASLIB=Main ∂
  108.                     -sn STDCLIB=Main ∂
  109.                     -sn SANELIB=Main ∂
  110.                     -sn StringUtils=Main ∂
  111.                     -sn UtilMain=Main
  112.  
  113. #------------------------------------------------------------------------------
  114. # These are modified default build rules.  This is necessary to take into
  115. # account differences between MPW 3.1 and 3.2
  116. #------------------------------------------------------------------------------
  117. {obj}            ƒ    {projsrc}
  118.  
  119. .c.o            ƒ    .c
  120.     {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  121.  
  122. {objppc}        ƒ    {projsrc}
  123.  
  124. .o                ƒ    .c
  125.     PPCC {PPCCOptions} {DepDir}{Default}.c -o {TargDir}{Default}.o
  126.  
  127. #------------------------------------------------------------------------------
  128. # These are the objects that we want to link with. If any one of these
  129. # changes, then we invoke the Link command.
  130. #------------------------------------------------------------------------------
  131. AppObjects        =    ∂
  132.                     {obj}Clipboard.c.o ∂
  133.                     {obj}Colors.c.o ∂
  134.                     {obj}DoEvent.c.o ∂
  135.                     {obj}Drag.c.o ∂
  136.                     {obj}EventLoop.c.o ∂
  137.                     {obj}File.c.o ∂
  138.                     {obj}IdleTasks.c.o ∂
  139.                     {obj}Menu.c.o ∂
  140.                     {obj}PenSizeDialog.c.o ∂
  141.                     {obj}Start.c.o ∂
  142.                     {obj}TExtSelectObj.c.o ∂
  143.                     {obj}TGroupObj.c.o ∂
  144.                     {obj}TLineObj.c.o ∂
  145.                     {obj}ToolPalette.c.o ∂
  146.                     {obj}TOvalObj.c.o ∂
  147.                     {obj}TPieObj.c.o ∂
  148.                     {obj}TRectObj.c.o ∂
  149.                     {obj}TreeObj2.c.o ∂
  150.                     {obj}TRootObj.c.o ∂
  151.                     {obj}TRRectObj.c.o ∂
  152.                     {obj}Window.c.o ∂
  153.                     {obj}WindowDialog.c.o ∂
  154.                     {obj}WindowPalette.c.o
  155.  
  156. AppObjectsPPC    =    ∂
  157.                     {objppc}Clipboard.o ∂
  158.                     {objppc}Colors.o ∂
  159.                     {objppc}DoEvent.o ∂
  160.                     {objppc}Drag.o ∂
  161.                     {objppc}EventLoop.o ∂
  162.                     {objppc}File.o ∂
  163.                     {objppc}IdleTasks.o ∂
  164.                     {objppc}Menu.o ∂
  165.                     {objppc}PenSizeDialog.o ∂
  166.                     {objppc}Start.o ∂
  167.                     {objppc}TExtSelectObj.o ∂
  168.                     {objppc}TGroupObj.o ∂
  169.                     {objppc}TLineObj.o ∂
  170.                     {objppc}ToolPalette.o ∂
  171.                     {objppc}TOvalObj.o ∂
  172.                     {objppc}TPieObj.o ∂
  173.                     {objppc}TRectObj.o ∂
  174.                     {objppc}TreeObj2.o ∂
  175.                     {objppc}TRootObj.o ∂
  176.                     {objppc}TRRectObj.o ∂
  177.                     {objppc}Window.o ∂
  178.                     {objppc}WindowDialog.o ∂
  179.                     {objppc}WindowPalette.o
  180.  
  181. #------------------------------------------------------------------------------
  182. # These help define the libraries that we want to link with. {AppObjects} holds
  183. # the names of the application units we want to link together. {Libs68K} and
  184. # {LibsPPC} hold the DTS.Lib and System library files we need to link with.
  185. #------------------------------------------------------------------------------
  186. Libs68K            =    ∂
  187.                     "{Libraries}Runtime.o" ∂
  188.                     "{DTS.Lib.folder}DTS.Lib_controls" ∂
  189.                     "{DTS.Lib.folder}DTS.Lib_ctlhandler" ∂
  190.                     "{DTS.Lib.folder}DTS.Lib_framework" ∂
  191.                     "{DTS.Lib.folder}DTS.Lib_strings" ∂
  192.                     "{DTS.Lib.folder}DTS.Lib_treeobj" ∂
  193.                     "{DTS.Lib.folder}DTS.Lib_utils" ∂
  194.                     "{Libraries}Interface.o"
  195.  
  196. LibsPPC            =    ∂
  197.                     "{DTS.Lib.folder}DTS.Lib_controls.PPC" ∂
  198.                     "{DTS.Lib.folder}DTS.Lib_ctlhandler.PPC" ∂
  199.                     "{DTS.Lib.folder}DTS.Lib_framework.PPC" ∂
  200.                     "{DTS.Lib.folder}DTS.Lib_strings.PPC" ∂
  201.                     "{DTS.Lib.folder}DTS.Lib_treeobj.PPC" ∂
  202.                     "{DTS.Lib.folder}DTS.Lib_utils.PPC" ∂
  203.                     "{PPCLibraries}"QuickTimeLib.xcoff ∂
  204. #                    "{PPCLibraries}"DragLib.xcoff      ... starting with ETO #15, use the line below ∂
  205.                     "{PPCLibraries}"DragLib ∂
  206.                     "{PPCLibraries}"InterfaceLib.xcoff ∂
  207.                     "{PPCLibraries}"PPCCRuntime.o
  208.  
  209.  
  210. #------------------------------------------------------------------------------
  211. # Dependencies for the individual components. These will invoke the
  212. # default build rules listed in Chapter 9 of the MPW 3.0 manual.
  213. # You may wish to reduce the number of dependencies.  Two dependencies
  214. # you may wish to remove are this makefile and the .protos file.
  215. # For the .protos file, if you add a function to the list of
  216. # functions in .protos, you will cause all the source files to be
  217. # recompiled.  This may be more than you want to wait for each time you
  218. # add a function to your application.  On the other hand, if you do not
  219. # include this in the dependencies, and you change the parameters for a
  220. # function, and make the respective change to .protos, any files
  221. # that reference that function will not be recompiled.  If these files are
  222. # recompiled, the prototype checking will catch any cases where you did
  223. # not change the way the altered function was called.  <<You choose>>
  224. #------------------------------------------------------------------------------
  225.  
  226. {AppObjects}    ƒ    #{AppName}.make ∂
  227. #                    App.h ∂
  228. #                    App.protos.h
  229.  
  230. #    This rule controls how the final app is built.
  231. #    By depending on both App68K and AppPPC, the "fat" version
  232. #    gets built.  To build 68K only or PowerPC only, remove the other
  233. #    dependency.
  234. {AppName}            ƒƒ AppRez App68K AppPPC
  235.     SetFile {AppName} -t APPL -c {Signature} -a B
  236.  
  237. #------------------------------------------------------------------------------
  238. # Build rule that links our application together. If any of our objects 
  239. # changes, or this makefile changes, then we relink.  The dummy prerequisite
  240. # ShellForce must come before any other prerequisites for {AppName}
  241. #------------------------------------------------------------------------------
  242.  
  243. App68K                ƒ {AppObjects}
  244.     Link {LinkOptions} -o {AppName} {AppObjects} {Libs68K}
  245.     Rez {RezOptions} AppCfrg.r -o {AppName}
  246.  
  247. #------------------------------------------------------------------------------
  248. # Build rule that creates our resources and adds them to the application
  249. #------------------------------------------------------------------------------
  250.  
  251. AppRez                ƒ    {AppName}.make ∂
  252.                         DTS.Draw.r ∂
  253.                         AppCfrg.r ∂
  254.                         App.h
  255.     Rez {RezOptions} DTS.Draw.r AppCfrg.r -o {AppName}
  256.  
  257. #------------------------------------------------------------------------------
  258. # Rules to build the PowerPC part
  259. #------------------------------------------------------------------------------
  260. AppPPC                ƒ    {AppName}.pef
  261.  
  262. {AppName}.xcoff        ƒ    {AppObjectsPPC}
  263.     PPCLink {LinkOptionsPPC} {AppObjectsPPC} {LibsPPC} -o {AppName}.xcoff
  264.  
  265. #    MakeSym is very timeconsuming, so we only do it if we really need it
  266. {AppName}.xSYM        ƒ {AppName}.xcoff
  267.     IF "{SymOptions}" != ""    && "{SymOptions}" != "-sym off"                
  268.         MakeSym {MakeSymOptions} {AppName}.xcoff -o {AppName}.xSYM
  269.     END
  270.  
  271. {AppName}.pef        ƒ    {AppName}.xcoff {AppName}.xSYM
  272.     MakePef {MakePefOptions} {AppName}.xcoff -o {AppName}
  273.     Rez {RezOptions} -d powerc AppCfrg.r -o {AppName}
  274.